﻿package com.tools
{
	import com.data.ImageVO;
	
	public class XmlParser
	{
		static private var _imageArray : Array;
		
		static public function parseXml ( pXml : XML ) : Array
		{
			XML.ignoreWhitespace = true;
			
			_imageArray = new Array();
			
			var fNode : XMLList = pXml.*;
			
			for each ( var node : XML in fNode )
			{
				if ( node.localName() == "image" )
				{
					var imageVO : ImageVO = new ImageVO( );
					imageVO.name 	= node.@imgName;
					imageVO.width	= node.@imgWidth;
					imageVO.height	= node.@imgHeight;
					
					_imageArray.push( imageVO );
				}
			}
			
			return _imageArray;
		}
	}
}